package com.leen.security;

import com.leen.security.domain.AdminLoginUserDetails;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 类说明
 *
 * @author admin
 * @date 2021-05-19
 */
public class CurrentAdminInfo {

    public static AdminLoginUserDetails getAdminLoginUserDetails(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        AdminLoginUserDetails adminLoginUserDetails = (AdminLoginUserDetails) authentication.getPrincipal();
        return adminLoginUserDetails;

    }
}
